package br.edu.unifei.mestrado.fm;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import br.edu.unifei.mestrado.fm.FMMemory;

public class MainFMMemory {

	private static Logger logger = LoggerFactory.getLogger(MainFMMemory.class);

	public static void main(String[] args) {
		String file = null;

		// executar assim: main false fileName.txt
		// ou: main true
		// ou sem nada, daí entra tudo via teclado
		if (args.length > 0) {
			file = args[0];
		} else {
			logger.error("Uso: MainFMMemory file");
			System.exit(2);
		}

		logger.warn("Iniciando FM em memória... file: " + file);

		long delta = System.currentTimeMillis();
		FMMemory fm = new FMMemory(file);
		fm.execute();
		delta = System.currentTimeMillis() - delta;
		logger.warn("Tempo gasto no FM: " + delta + " ms");
	}

}
